package org.xxpay.pay.channel.slzfbpay;

import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;

/**
 * @author: pangxiaoyu
 * @date: 20/12/07
 */
@Component
public class SlzfbpayConfig {

    public static final String CHANNEL_NAME = "slzfbpay";

    public static final String RETURN_VALUE_SUCCESS = "success";
    public static final String RETURN_VALUE_ERROR = "fail";

    // 商户账号
    private String mchId;
    // key
    private String key;
    // 请求地址
    private String reqUrl;
    // 跳转地址
    private String jumpUrl;

    public SlzfbpayConfig(){}

    public SlzfbpayConfig(String payParam) {
        Assert.notNull(payParam, "init "+ CHANNEL_NAME +" config error");
        JSONObject object = JSONObject.parseObject(payParam);
        this.mchId = object.getString("mchId");
        this.key = object.getString("key");
        this.reqUrl = object.getString("reqUrl");
        this.jumpUrl = object.getString("jumpUrl");
    }

    public String getMchId() {
        return mchId;
    }

    public void setMchId(String mchId) {
        this.mchId = mchId;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getReqUrl() {
        return reqUrl;
    }

    public void setReqUrl(String reqUrl) {
        this.reqUrl = reqUrl;
    }

    public String getJumpUrl() {
        return jumpUrl;
    }

    public void setJumpUrl(String jumpUrl) {
        this.jumpUrl = jumpUrl;
    }
}
